<?php 

/**
* 
*/
abstract class AbstractConfiguratorResource
{
	
	protected $_configurator;
	
	protected $_options = array();
	
	public function __construct()
	{
		
	}
	
	public function setConfigurator(AbstractConfigurator $configurator){
		$this->_configurator = $configurator;
	}
	
	public function setOptions(array $options){
		$this->_options = array();
		$env = $this->_configurator->getEnvironment();
		
		foreach ($options as $key => $value) {
			if(strpos($key,$env) !== false){
				$this->_options[str_replace($env.'_','',$key)] = $value;
			}
		}
		
		return $this;
	}
	
	public function getOption($name){
		return isset($this->_options[$name]) ? $this->_options[$name] : null;
	}
		
	abstract function init();
	
	abstract function run();
}


